home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / objFileOptions.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.0 KB  |  91 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc int objFileOptions ( string $parent, string $action,
  18.                                     string $initialSettings, string $resultCallback )
  19. //
  20. //    Description:
  21. //        This script posts the obj file accessor options.
  22. //
  23. //    Parameters:
  24. //        $parent    - the elf parent layout for this options layout. It is
  25. //                    always a scrollLayout.
  26. //        $action    - the action that is to be performed with this invokation
  27. //                    of this proc. Valid options are:
  28. //                        "query" - construct the options string and pass it
  29. //                                    to the resultCallback.
  30. //                        "post"    - post all the elf controls.
  31. //        $resultCallback    -
  32. //                This is the proc to be called with the result string. 
  33. //                resultCallback ( string $optionsString )
  34. //
  35. //    Returns:
  36. //        1 if successfull.
  37. //        0 otherwise.
  38. //
  39. {
  40.     int $result;
  41.     string $currentOptions;
  42.     string $optionList[];
  43.     string $optionBreakDown[];
  44.     int        $index;
  45.     
  46.     if ($action == "post") {
  47.         setUITemplate -pushTemplate DefaultTemplate;
  48.         setParent $parent;
  49.  
  50.         columnLayout -adj true objMultiObjCol;
  51.             radioButtonGrp
  52.                     -l "Create Multiple Objects"
  53.                     -nrb 2  -cw3 175 75 75
  54.                     -la2 "True" "False" 
  55.                     -sl 1
  56.                     objMultiObjGrp;
  57.                     
  58.         // Now set to current settings.
  59.         $currentOptions = $initialSettings;
  60.         if (size($currentOptions) > 0) {
  61.             tokenize($currentOptions, ";", $optionList);
  62.             for ($index = 0; $index < size($optionList); $index++) {
  63.                 tokenize($optionList[$index], "=", $optionBreakDown);
  64.                 if ($optionBreakDown[0] == "mo") {
  65.                     if ($optionBreakDown[1] == "0") {
  66.                         radioButtonGrp -e -sl 2 objMultiObjGrp;
  67.                     } else {
  68.                         radioButtonGrp -e -sl 1 objMultiObjGrp;
  69.                     }
  70.                 }
  71.             }
  72.         }
  73.         setUITemplate -popTemplate;
  74.         $result = 1;
  75.     
  76.     } else if ($action == "query") {
  77.         // Set MultiObj option
  78.         if (`radioButtonGrp -q -sl objMultiObjGrp` == 1) {
  79.             $currentOptions = $currentOptions + "mo=1";
  80.         } else {
  81.             $currentOptions = $currentOptions + "mo=0";
  82.         }
  83.         eval($resultCallback+" \""+$currentOptions+"\"");
  84.         $result = 1;
  85.     } else {
  86.         $result = 0;
  87.     }
  88.     
  89.     return $result;
  90. }
  91.